package cn.kgc.mybatis.dao.impl;

import cn.kgc.mybatis.dao.UserDao;
import cn.kgc.mybatis.entity.User;
import cn.kgc.mybatis.utils.JDBCUtil;
import sun.net.TelnetInputStream;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

/**
 * @author: mosin
 * @version: v1.0  2022/9/26
 */
public class UserDaoImpl implements UserDao {

    @Override
    public List<User> selectAll() throws SQLException {

        Connection connection = JDBCUtil.getConnection();
        String sql = "select * from user ";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);

        //  发送sql 处理结果集

        // 释放资源
        JDBCUtil.closeAll(null, preparedStatement, connection);

        return null;
    }

    @Override
    public Integer delete(Integer id) {
        return null;
    }
}
